Get a List of All Templates
The endpoint is used to get a list of video templates. This is a paginated endpoint and hence you will receive a paginated response.
Video templates only
Templates are only used by videos. Single images and carousels are made with Model Version 4, which does not use templates, so image, carousel, quotes and meme templates are no longer listed. Pass media_type as video: any other value, or leaving media_type out, gets HTTP status code 410 and the response below.
{
"templates": [],
"total_pages": 0,
"errors": [{
"field": "media_type",
"detail": "Templates are only available for media_type video. Single images and carousels are made with Model Version 4, which does not use templates.",
"solution": "Pass media_type as video to list video templates, or call create_content with model_version 4 without template_ids. See documentation: https://predis.ai/developers/"
}]
}
Request URL
- GET https://brain.predis.ai/predis_api/v1/get_templates/
Request Parameters
| Name | Description | Type | Default Value | Possible Values | Required |
|---|---|---|---|---|---|
brand_id | The brand_id serves as the unique identifier for your brand. Using the brand_id, you will also have access to your custom templates on the first page. | String | None | YOUR_BRAND_ID | Yes |
media_type | Media type of the templates. Only video templates are available. | String | None | video | Yes |
post_type | To obtain templates of a specific type of post. | String | generic | generic | No |
aspect_ratio | To obtain templates of a specific aspect ratio. | String | all | square, portrait, landscape, all | No |
page_n | Indicate the page number to retrieve templates from that particular page. | Integer | 1 | 1, 2, 3...etc | No |
items_n | Indicate the desired number of templates for each page. | Integer | 10 | 1, 2, 3...etc | No |
Sample Success Response
{
"templates": [{
"template_id": "...",
"media_type": "..."
}],
"total_pages": 50,
"errors": []
}
Sample Error Response
{
"errors": [{
"detail": "...",
"solution": "..."
}]
}
Response Codes
| HTTP Status Code | Error Code | User Message | Recommended solution |
|---|---|---|---|
| 429 | 001 | Maximum number of requests reached | Maximum number of hourly requests reached You have been rate-limited. Wait for sometime and try again |
| 400 | 002 | Invalid brand_id provided | You have provided an invalid brand_id. Please provide a valid brand_id and try again. Read more here |
| 400 | 003 | Page numbers of Items number is invalid | Make sure the value of page_n and items_n is integer |
| 400 | 004 | Provided aspect_ratio is not supported | Make sure the value of aspect_ratio field is supported. Please check the Request Parameters in the above table for more details |
| 400 | 006 | The provided value for the video_duration field is not valid | Make sure the value is either short or long |
| 400 | 007 | The provided value for the post_type field is not valid | Make sure the value is generic |
| 410 | - | Templates are only available for media_type video | Pass media_type as video. Single images and carousels are made with Model Version 4 and need no templates |
Rate Limiting
Standard API rate limits apply to this endpoint. Read more about the rate limits here